package com.lottery.ruok.lottrey.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;

import com.lottery.ruok.lottrey.R;
import com.lottery.ruok.lottrey.adapter.LXCTrendAdapter;
import com.lottery.ruok.lottrey.retrofitModule.response.LiuhecaiTrendResponse;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by ASUS on 2017/7/27.
 */

public class LXCTrendFragment extends BaseFragment {
    @BindView(R.id.zonghe)
    LinearLayout zonghe;
    @BindView(R.id.tema)
    LinearLayout tema;
    @BindView(R.id.listview)
    ListView listview;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.lhc_trend_fragment, container, false);

        ButterKnife.bind(this, view);

        init();
        return view;
    }


    private void init() {
        ArrayList<LiuhecaiTrendResponse> liuhecaiTrendResponseList = getArguments().getParcelableArrayList("lists");

        if (getArguments().getInt("index") == 1) {
            tema.setVisibility(View.GONE);
        } else if (getArguments().getInt("index") == 2) {
            zonghe.setVisibility(View.GONE);
        }

        listview.setAdapter(new LXCTrendAdapter(this, liuhecaiTrendResponseList));
    }
}
